home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Languages / Oberon⁄F™ 1.1 / System / Docu / Domains (.txt) < prev    next >
Encoding:
Oberon Document  |  1996-01-05  |  4.5 KB  |  91 lines  |  [oODC/obnF]

  1. Documents.StdDocumentDesc
  2. Documents.DocumentDesc
  3. Containers.ViewDesc
  4. Views.ViewDesc
  5. Stores.StoreDesc
  6. Documents.ModelDesc
  7. Containers.ModelDesc
  8. Models.ModelDesc
  9. Stores.ElemDesc
  10. TextViews.StdViewDesc
  11. TextViews.ViewDesc
  12. TextModels.StdModelDesc
  13. TextModels.ModelDesc
  14. TextModels.AttributesDesc
  15. Helvetica
  16. TextRulers.StdRulerDesc
  17. TextRulers.RulerDesc
  18. TextRulers.StdStyleDesc
  19. TextRulers.StyleDesc
  20. TextRulers.AttributesDesc
  21. Helvetica
  22. Helvetica
  23. Helvetica
  24. Helvetica
  25. Domains
  26. DEFINITION Domains;
  27.     TYPE
  28.         Message = RECORD END;
  29.         Domain = POINTER TO DomainDesc;
  30.         DomainDesc = RECORD 
  31.             PROCEDURE (d: Domain) Handle (VAR msg: Message)
  32.         END;
  33.         OpName = ARRAY 32 OF CHAR;
  34.         Operation = POINTER TO OperationDesc;
  35.         OperationDesc = RECORD 
  36.             inUse-: BOOLEAN;
  37.             name-: OpName;
  38.             PROCEDURE (op: Operation) Do
  39.         END;
  40.     PROCEDURE InitName (op: Operation; name: OpName);
  41.     PROCEDURE MarkAsUsed (op: Operation);
  42. END Domains.
  43. A domain delineates the boundaries between a group of objects and their environment. The objects contained in a document are an example of such a group: the document and its components belong to one domain. When an object of a domain has been modified, the other objects of the same domain may be notified by broadcasting a message to them.
  44. Apart from reducing message traffic, domains may have other purposes as well: if the objects in a domain are persistent (-> Stores), the domain defines which objects are stored in a particular file and which are not.
  45. For documents, a domain is also the scope for undo/redo operations: every document domain manages its own undo/redo stacks for operations.
  46. TYPE Message
  47. Interface
  48. This is the base type of messages to be broadcast in one (or sometimes in several) domains.
  49. Messages are used internally.
  50. Messages are extended internally.
  51. TYPE Domain
  52. Interface
  53. Domains define boundaries around objects, they define which objects are "inside" and which are "outside" from their point of view.
  54. Domains are used in Stores (-> Stores) to define groups of persistent objects. Each document belongs to at most one domain, notification messages are usually broadcast throughout one domain, and undo/redo is performed on a per-domain basis.
  55. PROCEDURE (d: Domain) Handle (VAR msg: Message)
  56. Empty
  57. Message handler for a domain.
  58. Handle is called internally.
  59. Handle is extended internally.
  60. TYPE OpName
  61. String type for the name of an operation.
  62. TYPE Operation
  63. Operations are objects which perform modifications on other objects. All objects modified by the operation must belong to the same domain. The operation's Do procedure performs the desired modification, and must be involutory, i.e. when called twice, its effect must have been neutralized again.
  64. inUse-: BOOLEAN
  65. Tells whether the operation is alreay in use by a domain.
  66. name-: OpName
  67. The operation's name.
  68. PROCEDURE (op: Operation) Do
  69. Interface
  70. This procedure performs a modification on other objects. It must be involutory, i.e. it must have the identical effect if called an odd number of times, and no effect if called an even number of times.
  71. Do is called internally.
  72. Do must be extended by every concrete operation; many model (-> Models) and view (-> Views) modifications are implemented as operations.
  73. PROCEDURE InitName (op: Operation; name: OpName)
  74. Initializes the operation's name.
  75. InitName is called internally.
  76. op # NIL    20
  77. op.name = ""    21
  78. op.name = name
  79. PROCEDURE MarkAsUsed (op: Operation)
  80. Marks the operation as "in use".
  81. MarkAsUsed is called internally.
  82. op # NIL    20
  83. ~op.inUse    21
  84. op.inUse
  85. TextControllers.StdCtrlDesc
  86. TextControllers.ControllerDesc
  87. Containers.ControllerDesc
  88. Controllers.ControllerDesc
  89. Helvetica
  90. Documents.ControllerDesc
  91.